{% extends 'base_template/adminBase.html' %}

!-- Main content -->
{% block main_content %}
    <section class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-12">
                    <!-- general form elements -->
                    <div class="card card-primary">
                        <div class="card-header">
                            <h3 class="card-title">添加课程</h3>
                        </div>
                        <!-- /.card-header -->
                        <!-- form start -->
                        <form role="form" action="{% url 'completeAddCourse' %}" method="post">
                            {% csrf_token %}
                            <div class="card-body">
                                <div class="form-group" style="line-height: 60px">
                                    <label>课程名 </label>
                                    <input type="text" class="form-control" name="course" placeholder="请输入课程名称">
                                </div>
                                <div class="form-group" style="line-height: 60px">
                                    <label>学分 </label>
                                    <input type="text" class="form-control" name="credit" placeholder="学分">
                                </div>
                                <div class="form-group">
                                    {% if messages %}
                                        {% for message in messages %}
                                            {% if message.tags == 'error' %}
                                                <div class="alert alert-danger"
                                                     style="margin-top:10px">{{ message }}</div>
                                            {% endif %}
                                            {% if message.tags == 'success' %}
                                                <div class="alert alert-success"
                                                     style="margin-top:10px">{{ message }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                </div>

                            </div>
                            <!-- /.card-body -->

                            <div class="card-footer" style="line-height: 60px">
                                <button type="submit" class="btn btn-primary btn-block">Add Course</button>
                            </div>
                        </form>
                    </div>
                    <!-- /.card -->
                </div>
            </div>
        </div>
    </section>
{% endblock main_content %}
<!-- /.content -->